package com.yonyou.pmclouds.personnel.mapper;

import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import com.yonyou.pmclouds.basecom.dao.impl.mybatis.BaseSQLProvider;
import com.yonyou.pmclouds.personnel.entity.PersonnelSearchConditionVO;
import com.yonyou.pmclouds.personnel.entity.PersonnelVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.UpdateProvider;

/**
 * @Author chulf
 * @Date 2020/4/13
 * @Description
 **/
public interface PersonnelMapper extends BaseMapper<PersonnelVO> {

    PersonnelVO[] selectPersonnelsVOByUserId(String userId);

    PersonnelVO[] queryByUserIds(@Param("userIds") String[] userIds, @Param("pkTenant") String pkTenant);

    Integer selectRefByCode(@Param("code")String code, @Param("ids") String[] ids);

    PersonnelVO[] selectPersonnelVOSByPkEtp(String pkEnterprise);

    PersonnelVO[] selectPersonnelVOSByPkEtps(@Param("pkEtps") String[] pkEtps);

    PersonnelVO[] search(PersonnelSearchConditionVO conditionVO);

    int searchCountByCondition(PersonnelSearchConditionVO conditionVO);

    @UpdateProvider(type = BaseSQLProvider.class,method = "batchUpdateFieldsByPks")
    void updateAuthorized(@Param("vo") PersonnelVO personnelVO,@Param("fields") String[] fields,@Param("pks") String[] pks);

    PersonnelVO[] selectPersonnelVOSByPks(@Param("pks")String[] pks);
}
